home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / lxlt113.zip / LXUTIL.ENG < prev    next >
Text File  |  1996-05-06  |  12KB  |  231 lines

  1.              ───────────────────────────────────
  2.                  lxLite utility pack
  3.              ───────────────────────────────────
  4.  
  5.  
  6.  1.Abstract
  7.  ──────────
  8.    Some  time  after  releasing version 1.01 of lxLite (i.e. 1.0.1) (and some
  9.  time  before  :-)  I  wrote  some simple command-line utilites which greatly
  10.  simplified  my  life.    Because  apart from lxLite they don`t present nothing
  11.  interesting, I included them here for you to get them along with lxlite :-)
  12.  
  13.  2.unLock
  14.  ────────
  15.    unLock   is     a  simple  utility  which  allows  to    `unlock`  application
  16.  executables  which  is  currently  in    use.  Normally when an executable is
  17.  loaded by OS/2 its file is open with a deny-write sharing mode. This is done
  18.  because  LX  format  structure  is  designed not to swap out unused pages in
  19.  executables each time when they aren`t needed anymore, but rather to discard
  20.  them.    When  discardrd  page  is  needed  OS/2  simply  reads    it again from
  21.  executable.
  22.    However,  there is still a way to replace executables `on-the-fly` even if
  23.  they  are currently running. There is an so-called `well-known undocumented`
  24.  function  (which  in  fact  means  that it won`t be neccesarily supported in
  25.  future  versions  of OS/2) which allow to disable sharing protection on such
  26.  files.  Before  doing    that  OS/2 reads entire executable in swap file, then
  27.  page  swapping is done as with usual memory. If you`ll `unlock` many running
  28.  executables  at  the same time you can notice an increase in swap file size.
  29.  So,  this  is just an temporary work-around, you have better to reboot after
  30.  doing all neccesary things on former locked files.
  31.    The    command-line  format  of unLock is much like lxLite`s, except that it
  32.  have  much  less  options  :-)
  33.  
  34.      /E{+|-} r[E]cursive (+) file search through subdirectories
  35.          unLock will recursively search any directories which is
  36.          located below the directory of given filemask. If multiple 
  37.          masks are given multiple recursive searchs will be performed.
  38.  
  39.      /P{+|-} Enable (+) or disable (-) pause before each file
  40.          Before each file chCase will ask you whenever you really want
  41.          to unlock the file.
  42.  
  43.      /V{+|-} Verbose (show a lot of additional information)
  44.          If verbose option is disabled (/V-) only those messages are
  45.          left on screen which displays critical messages (i.e. errors),
  46.          otherwise after each filename unLock shows the result of unlock
  47.          operation - 'unlocked' or 'sharing violation'. Note that unLock
  48.          CANNOT unlock files which are locked in some other way than
  49.          executbles.
  50.  
  51.      /?,/H   Show a short help screen
  52.  
  53.  3.chCase
  54.  ────────
  55.    Some  time ago I was finally bored of the annoying habbit of some programs
  56.  to  write  their  files  in  upper  case.  And not only contents (almost any
  57.  program  which changes config.sys tends to convert it all to upper case when
  58.  I  like it to be in lower case) but filenames also. So i started this little
  59.  project as a problem-dedicated-and-easy-to-use replacement for REN command.
  60.  
  61.    The    main ideology of chCase is to divide filename in some `parts` then to
  62.  perform  some    case-conversions  on each part apart :-) You can define `part
  63.  separator` characters using /S"" option. By default chCase uses "." as `part
  64.  separator`.  I.e. filename chcase.is.a.great.prog will be divided into parts
  65.  'chcase',  'is',  'a',  'great'  and  'prog'. Further you can tell chCase to
  66.  convert  first  part to upper-case, second - to lower-case, third - to mixed
  67.  format (i.e. first letter in uppercase and rest in lowercase) and so on.
  68.  
  69.    The available options are:
  70.  
  71.     /C{#{.}} Convert to [L]ower/[U]pper/[M]ixed/[A]s-is case
  72.          You can define multiple `case conversion actions` - first one
  73.          will be applied on the first `part`; second - on the second
  74.          `part` and so on. Last `action` will be used for any extra
  75.          encountered `parts`, so if you`ll define only one option it
  76.          will be applyed on all filename parts. Some examples:
  77.  
  78.          filename             command line     resulting filename
  79.          ───────────────────────┬────────────────┬────────────────────────
  80.          mY.Very.lOnG.fIlE.NamE │/culam my*      │MY.very.lOnG.File.Name
  81.          just.an.example        │/cml jus*         │Just.an.example
  82.          leT.iT.bE            │/cmla let*      │Let.it.bE
  83.  
  84.     /E{+|-}  r[E]cursive (+) file search through subdirectories
  85.          chCase will recursively search any directories which are
  86.          located below the directory of given filemask. If multiple
  87.          masks are given multiple recursive searchs will be performed.
  88.  
  89.     /P{+|-}  Enable (+) or disable (-) pause before each file
  90.          Before each file chCase will ask you whenever you really want
  91.          to rename this file. The initial and final filenames are
  92.          displayed.
  93.  
  94.     /S"{#}"  Define separator character(s) OVER old ones
  95.          You can use this switch in the case when you have some files
  96.          which uses some other separators, for example space or
  97.          underscore. Note that the /S switch is NOT additive i.e.
  98.          any /S switch disables the action of precedent. Even "."
  99.          is cleared by /S switch, so if you for example want to use
  100.          as separators both "." and space " " you have to define them
  101.          both in a single /S switch as follows: /S" ."
  102.  
  103.          Just some examples:
  104.  
  105.          filename             command line     resulting filename
  106.          ───────────────────────┬────────────────┬────────────────────────
  107.          Mary has a Little.Lamb │/cm /s" ." mar* │Mary Has A Little.Lamb
  108.          john_wAs_a_lItTle_lame │/cuml /s"_"     │JOHN_Was_a_little_lame
  109.  
  110.     /V{+|-}  Verbose (show a lot of additional information)
  111.          If you will specify /V- chcase will leave on screen only
  112.          critical messages such as errors - all others will be cleared
  113.          immediately after they succeeded.
  114.  
  115.     /?,/H    Show a short help screen
  116.  
  117.  4.colMng
  118.  ────────
  119.    ColMng  is  a  simple  utility which will allow you to manipulate PM color
  120.  palettes,  in    particular  to    save, restore, copy them from file to file as
  121.  well as copying them inside the same .INI file. All color palettes which are
  122.  visible  in  Scheme  Palette  are  a entry in OS2SYS.INI; i.e. to copy color
  123.  palette  from one system to another you have to save the needed entry into a
  124.  separate  .INI  file and to `load` color palette on target machine. Now some
  125.  words    about  how and where the palettes are saved: The `default` palette is
  126.  kept  as  a  'PM_Default_Colors`  entry  in  OS2.INI  file;  it has the same
  127.  format  as  other  palettes:  the  only difference between them is that most
  128.  palettes  resides  in OS2SYS.INI but default colors are kept in OS2.INI. The
  129.  entry has a lot of subentries such as `ShadowHiliteBgnd', 'FieldBackground',
  130.  'DesktopText` and so on.
  131.    Along  with    PM_Default_Colors  there  is another palette entry in OS2.INI
  132.  called  PM_Colors. What is the difference between them? As far as I observed
  133.  PM_Default_Colors  is    the  palette  which  is used when you load some other
  134.  shell    replacement  (not  WPS),  and  PM_Colors  seems  to be used only when
  135.  WorkPlaceShell  is loaded. Note that any change regarding system colors will
  136.  act  only  after  reboot.  There  is a way to set colors directly, but I use
  137.  ColMng seldom and don`t bother about this :-)
  138.  ColMng is a command-line utility which have a lot of options (I already said
  139.  that I like them :-) They are:
  140.  
  141.  /C{#} Set custom palette. To view a list of available palettes use blank
  142.        palette name. If you specify a name after /C this will copy specified
  143.        PM_# entry from OS2SYS.INI into PM_Default_Colors entry of OS2.INI file.
  144.        If you are using WorkPlace Shell you will not notice changes without
  145.        removing the PM_Colors entry (see /D option).
  146.  
  147.  /S{#} Save color palette into resource file; empty name for default palette.
  148.        The specified palette (for example PM_Khaki_Colors) will be saved into
  149.        specified in command line file. The file will have a regular .INI
  150.        structure. For example ColMng /S mycols.ini will save PM_Default_Colors
  151.        entry into file `mycols.ini`.
  152.  
  153.  /L{#} Load color palette from resource file; empty name for default palette
  154.        This is the inverse for /S function: it loads specified palette entries
  155.        from specified file: for example ColMng /L mycols.ini will restore
  156.        PM_Default_Colors from file 'mycols.ini'.
  157.  
  158.  /R{#} Remove specified palette; empty name for default palette
  159.        This will remove specified entry *completely* from the .INI file.
  160.        You can remove obsolete palettes to keep .INIs small; you also can
  161.        remove default palette to restore to default PM colors.
  162.  
  163.  /V{#} View sections in .INI file beginning from # (PM_ to list schemes)
  164.        This will display a list of sections in specified .INI file (or from
  165.        OS2SYS.INI if not specified) which starts from #. For example
  166.        ColMng /VPM_ will display a list of sections which refers to
  167.        Presentation Manager.
  168.  
  169.  /A{#} Set alternative .INI file (for Save & Load operations)
  170.        By default save & load operations will use OS2.INI file if you
  171.        save or restore default colors and OS2SYS.INI file if you specified
  172.        other palette scheme. This switch allow you to specify directly
  173.        which .INI file to use for save & restore operations.
  174.  
  175.  /D    Set PM default colors to current colors
  176.        This switch will copy PM_Colors into PM_Default_Colors.
  177.        This option is useful if you are using an PM shell replacement
  178.        such as PC/2, FileBar, MegaDesk etc. When changing default palette
  179.        from WorkPlaceShell (Alt+drag scheme) for some reason WPS changes
  180.        only PM_Colors and PM_Default_Colors remain almost (???) the same,
  181.        however the background color seems to change as expected; however
  182.        most colors (for example selection fields, help background etc)
  183.        doesn`t change. Use ColMng /D to set palette for other shell
  184.        replacements.
  185.  
  186.    Along  with    the  ColMng  itself  I    included a sample palette file called
  187.  AndyCols.ini  which  contains    my  current  desktop colors (however I change
  188.  them  very  often  :-) Use `ColMng /l andycols.ini` to try them then restart
  189.  the shell (or better reboot).
  190.  
  191.  5.noEA
  192.  ──────
  193.    As  you probably know :-) many (in fact a lot) of files have EAs (extended
  194.  attributes),  but  does  not  need them. In fact the only thing which REALLY
  195.  needs extended attributes is your Desktop\ directory. All other files can or
  196.  can  not  have  extended  attributes  -  the only thing that you can lose by
  197.  removing  those  attributes is how that file will appear in WPS folder (size
  198.  and  icon).  Other  type  of extended attributes is those used by REXX - any
  199.  REXX  program    that  you  run at least once and which does not have ReadOnly
  200.  attribute  set  have some K of extended attributes attached to it even if it
  201.  does  not really need them (I haven`t seen a REXX program which needs them).
  202.  So you can delete them and nothing will change except that you will win some
  203.  K  of    freespace  on  disk.  Note that if you have not too many EAs (say the
  204.  .TYPE    and the .APPTYPE ones) they will NOT occupy any disk space because of
  205.  the  wise HPFS structure. So to use noEA you MUST know what you`re doing and
  206.  whenever you needs it.
  207.  
  208.    noEA  can  show a list of extended attribute names for the processed files
  209.  or  remove all of them. The command-line switches are much like in all other
  210.  utilites:
  211.  
  212.  /E{+|-} r[E]cursive (+) file search through subdirectories
  213.      noEA will recursively search any directories which is
  214.      located below the directory of given filemask. If multiple
  215.      masks are given multiple recursive searchs will be performed.
  216.      
  217.  /P{+|-} Enable (+) or disable (-) pause before each file
  218.      noEA will ask for confirmation before each processed file.
  219.  
  220.  /V{+|-} Verbose (show EAs instead of removing them)
  221.      When this switch is used noEA will display the EAs attached
  222.      to processed file and will NOT remove them.
  223.  
  224.  /Y{+|-} assume (+) on all queries first available responce
  225.      When noEA encounters an write-locked file it warns you about this.
  226.      However, this can be annoying when doing automatical processing
  227.      (i.e. calling noEA from batch files). You can force noEA to process
  228.      any files it can by specifying this switch.
  229.  
  230.  /?,/H     Show a short help screen
  231.